* ======================================
* ------------- Placebosim -------------
* ======================================


* Simulate
* ========
	run $prog/prog_placebosim.do
	
	simulate b_Fam1=b_Fam1 b_Fam2=b_Fam2 b_Work1=b_Work1 b_Work2=b_Work2 ///
		b_Imm1=b_Imm1 b_Imm2=b_Imm2, seed(1234) reps(100): placebosim


* Make histograms
* ===============
	
	* Family
	local b_Fam1_star = 0.026
	local b_Fam2_star = 0.015
	foreach net in Fam1 Fam2{
		if "`net'" == "Fam1" local title = "Close"
		if "`net'" == "Fam2" local title = "Extended"
		hist b_`net', horizontal scheme(plotplain) width(0.002) ///
			ylab(-0.05(0.01)0.05, format(%3.2f)) ytitle(Estimates) ///
			yline(`b_`net'_star', lwidth(thick) lpattern(solid) ///
				lcol(cranberry)) ///
			yline(0, lwidth(medium) lpattern(solid)) ///
			ytitle(, size(large)) ylab(, labsize(medium)) ///
			xtitle(, size(large)) xlab(#4, labsize(medium)) ///
			title(`title', size(large)) name(sim_`net', replace)
	}
	
	graph combine sim_Fam1 sim_Fam2, row(1) scheme(plotplain) ///
		ycommon title(Family, size(large)) name(sim_Fam, replace)


	* Co-workers
	local b_Work1_star = 0.014
	local b_Work2_star = 0.010
	foreach net in Work1 Work2{
		if "`net'" == "Work1" local title = "Age-estbl."
		if "`net'" == "Work2" local title = "Estbl."
		hist b_`net', horizontal scheme(plotplain) width(0.002) ///
			ylab(-0.05(0.01)0.05, format(%3.2f)) ytitle(Estimates) ///
			yline(`b_`net'_star', lwidth(thick) lpattern(solid) ///
				lcol(cranberry)) ///
			yline(0, lwidth(medium) lpattern(solid)) ///
			ytitle(, size(large)) ylab(, labsize(medium)) ///
			xtitle(, size(large)) xlab(#4, labsize(medium)) ///
			title(`title', size(large)) name(sim_`net', replace)
	}
	
	graph combine sim_Work1 sim_Work2, row(1) scheme(plotplain) ///
		ycommon title(Co-workers, size(large)) name(sim_Work, replace)


	* Immigrants
	local b_Imm1_star = 0.045
	local b_Imm2_star = 0.036
	foreach net in Imm1 Imm2{
		if "`net'" == "Imm1" local title = "3-digit"
		if "`net'" == "Imm2" local title = "2-digit"
		hist b_`net', horizontal scheme(plotplain) width(0.002) ///
			ylab(-0.05(0.01)0.05, format(%3.2f)) ytitle(Estimates) ///
			yline(`b_`net'_star', lwidth(thick) lpattern(solid) ///
				lcol(cranberry)) ///
			yline(0, lwidth(medium) lpattern(solid)) ///
			ytitle(, size(large)) ylab(, labsize(medium)) ///
			xtitle(, size(large)) xlab(#4, labsize(medium)) ///
			title(`title', size(large)) name(sim_`net', replace)
	}

	graph combine sim_Imm1 sim_Imm2, row(1) scheme(plotplain) ///
		ycommon title(Immigrants, size(large)) name(sim_Imm, replace)


	* Combine all
	graph combine sim_Fam sim_Work sim_Imm, row(1) ///
		scheme(plotplain) ycommon xsize(9)
	
	graph export "$figs/Placebosim.pdf", replace
